<include file="Public/head" />

<body>
  <div class="panel admin-panel margin-top">
    <div class="panel-head" id="add"><strong><span class="icon-pencil-square-o"></span> {:L("tianjia")}</strong></div>
    <div class="body-content">
      <form method="post" class="form-x" action="?" enctype="multipart/form-data">
        <div class="form-group">
          <div class="label">
            <label>{:L('qingshuru')}{:L('menmianmingcheng')}：</label>
          </div>
          <div class="field">
            <input type="text" class="input w50" name="store_name" data-validate="required:{:L('qingshuru')}{:L('menmianmingcheng')}"/>
            <div class="tips"></div>
          </div>
        </div>

        <div class="form-group">
          <div class="label">
            <label>请输入门面appId：</label>
          </div>
          <div class="field">
            <input type="text" class="input w50" name="appid" data-validate="required:请输入门面appId"/>
            <div class="tipss"></div>
          </div>
        </div>

        <div class="form-group">
          <div class="label">
            <label>appsecret：</label>
          </div>
          <div class="field">
            <input type="text" class="input w50" name="secret" data-validate="required:请输入门面appsecret"/>
            <div class="tipss"></div>
          </div>
        </div>

        <div class="form-group">
          <div class="label">
            <label>请输入门面app_key：</label>
          </div>
          <div class="field">
            <input type="text" class="input w50" name="app_key" data-validate="required:请输入门面app_key"/>
            <div class="tipss"></div>
          </div>
        </div>

        <div class="form-group">
          <div class="label">
            <label>请输入门面商户ID：</label>
          </div>
          <div class="field">
            <input type="text" class="input w50" name="mch_id" data-validate="required:请输入门面商户ID"/>
            <div class="tipss"></div>
          </div>
        </div>
        <div class="form-group">
          <div class="label">
            <label>{:L('qingshuru')}{:L('menmiandizhi')}：</label>
          </div>
          <div class="field">
            <input type="text" class="input w50" name="store_address" data-validate="required:{:L('qingshuru')}{:L('menmiandizhi')}"/>
            <div class="tips"></div>
          </div>
        </div>
        <div class="form-group">
          <div class="label">
            <label>请输入门面联系人：</label>
          </div>
          <div class="field">
            <input type="text" class="input w50" name="store_user" data-validate="required:请输入门面联系人"/>
            <div class="tipss"></div>
          </div>
        </div>
        <div class="form-group">
          <div class="label">
            <label>{:L("suolvetu")}：</label>
          </div>
          <div class="field">
            <input type="file" class="button bg-blue" name="cate_thumb" value="+ {:L('liulanshangchuan')}" onchange="preview(this)" style="float: left;">
            <div id="preview" name="img" style="float: left;width: 10%;box-sizing: border-box;" class="input" >
              <empty name="info['company_logo']">
                <img src="__PUBLIC__/images/zanwu.jpg" width="100%" />
                <else />
                <img src="__ROOT__/{$info['thumb']}" width="100%" />
              </empty>
            </div>
            <div class="tipss">{:L("tuijianchicun")}：100*100</div>
          </div>
        </div>
        <div class="tipss"></div>
        <div class="form-group">
          <div class="label">
            <label>{:L('qingshuru')}{:L('menmiandianhua')}：</label>
          </div>
          <div class="field">
            <input type="text" class="input w50" name="store_tel" data-validate="required:{:L('qingshuru')}{:L('menmiandianhua')}"/>
            <div class="tips"></div>
          </div>
        </div>
        <div class="form-group">
          <div class="label">
            <label>请输入门面营业时间：</label>
          </div>
          <div class="field">
            <input type="text" class="input w50" name="store_time" data-validate="required:请输入门面营业时间"/>
            <div class="tipss">输入格式如:9:00-22:00</div>
          </div>
        </div>
        <div class="form-group">
          <div class="label">
            <label>{:L('qingshuru')}{:L('menmianyouxiang')}：</label>
          </div>
          <div class="field">
            <input type="email" class="input w50" name="store_email" data-validate="required:{:L('qingshuru')}{:L('menmianyouxiang')}"/>
            <div class="tips"></div>
          </div>
        </div>
        <div class="form-group">
          <div class="label">
            <label>{:L('qingshuru')}{:L('weixingongzhonghao')}：</label>
          </div>
          <div class="field">
            <input type="text" class="input w50" name="store_public" data-validate="required:{:L('qingshuru')}{:L('weixingongzhonghao')}"/>
            <div class="tips"></div>
          </div>
        </div>
        <div class="form-group">
          <div class="label">
            <label>{:L('qingshuru')}{:L('jingdu')}：</label>
          </div>
          <div class="field">
            <input type="text" class="input w50" name="address_lng" data-validate="required:{:L('qingshuru')}{:L('jingdu')}"/>
            <div class="tips"></div>
          </div>
        </div>
        <div class="form-group">
          <div class="label">
            <label>{:L('qingshuru')}{:L('weidu')}：</label>
          </div>
          <div class="field">
            <input type="text" class="input w50" name="address_lat" data-validate="required:{:L('qingshuru')}{:L('weidu')}"/>
            <div class="tipss">tip:公司经纬度可通过<a href="http://lbs.qq.com/tool/getpoint/index.html" target="_blank">http://lbs.qq.com/tool/getpoint/index.html</a>获取</div>
          </div>
        </div>
        <div class="form-group">
          <div class="label">
            <label>门店简介：</label>
          </div>
          <div class="field">
            <input type="text" class="input w50" name="intro" data-validate="请输入门店简介"/>
            <div class="tips"></div>
          </div>
        </div>
        <div class="form-group">
          <div class="label">
            <label></label>
          </div>
          <div class="field">
            <button class="button bg-main icon-check-square-o" type="submit">{:L('tianjia')}</button>
          </div>
        </div>
      </form>
    </div>
  </div>
</body>
<script>
  function preview(file)
  {
    var prevDiv = document.getElementById('preview');
    if (file.files && file.files[0])
    {
      var reader = new FileReader();
      reader.onload = function(evt){
        prevDiv.innerHTML = '<img src="' + evt.target.result + '" width="100%" />';
      }
      reader.readAsDataURL(file.files[0]);
    }
    else
    {
      prevDiv.innerHTML = '<div class="img" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src=\'' + file.value + '\'"></div>';
    }
  }
</script>
</html>